<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<body>
				<script type="text/javascript">
					//水仙花函数，通过参数传递数字，判断是否满足要求
					function narcissus(num){
						var n=parseInt(num)
						var sum=0;
						var a,b,c;
						//拆分成3位
						a=parseInt(n%10);
						b=parseInt(n/10%10);
						c=parseInt(n/100%10);
						sum=a*a*a+b*b*b+c*c*c;
						//判断是否相等
						if(num===sum){
							return true;
						}
						else{
							return false;
						}
					}
					
					for(var num=100;num<1000;num++){
						if(narcissus(num)){
							document.write(num+"<br>");
						}
					}
				</script>
		</body>
	</head>
	<body>
	</body>
</html>